/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.lanchat.model.data;

import java.io.Serializable;

/**
 * 点对点通信时传输的信息类
 * @author 张易恒
 */
public class ChatMessage implements Serializable{
    public static final int LOGIN=0;
    public static final int LOGOUT=1;
    public static final int MSG=2;
    public static final int NULL=9;
    public static final int FILE_SEND =3;
    public static final int FILE_RECV=4;
    private String msg;
    private String user;
    private int type;
    private String IP;

    public ChatMessage(){
    }

    public ChatMessage(String msg,String user){
        this.msg=msg;
        this.user=user;
        type=ChatMessage.MSG;
    }

    public ChatMessage(String msg,String user,String ip,int type){
        this.msg=msg;
        this.user=user;
        this.type=type;
        this.IP=ip;
    }
    /**
     * @return the msg
     */
    public String getMsg() {
        return msg;
    }

    /**
     * @param msg the msg to set
     */
    public void setMsg(String msg) {
        this.msg = msg;
    }

    /**
     * @return the user
     */
    public String getUser() {
        return user;
    }

    /**
     * @param user the user to set
     */
    public void setUser(String user) {
        this.user = user;
    }

    /**
     * @return the type
     */
    public int getType() {
        return type;
    }

    /**
     * @param type the type to set
     */
    public void setType(int type) {
        this.type = type;
    }

    /**
     * @return the IP
     */
    public String getIP() {
        return IP;
    }

    /**
     * @param IP the IP to set
     */
    public void setIP(String IP) {
        this.IP = IP;
    }
    
}
